#include <bits/stdc++.h>

using namespace std;

class Solution
{
public:
    string kthDistinct(vector<string> &arr, int k)
    {
        unordered_map<string, int> hash;
        string ret;
        for (auto &e : arr)
        {
            hash[e]++;
        }
        for (auto e : arr)
        {
            if (hash[e] == 1)
            {
                --k;
                if (k == 0)
                {
                    ret = e;
                    break;
                }
            }
        }
        return ret;
    }
};